﻿using System.Collections.Generic;
using System.Linq;

namespace MinefieldCheat
{
    public static class CMinefieldCheat
    {
        public static string[] Mogelzettel(string[] inputMinefield )
        {
            var minefield = new CMinefieldMap(inputMinefield);
            var cheatmap = new CCheatMapBuilder( minefield.Width,minefield.Height);

            for ( int y = 0 ; y< minefield.Height; y++)
                for ( int x = 0 ; x<minefield.Width;x++)
                {
                    int bombs = minefield.CountBombsAroundPosition(x, y);
                    cheatmap.SetAt(x,y,bombs);
                }

            return cheatmap.GetCheatMap();
        }
    }
}
